﻿using BigEgg.Framework.Foundation;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Objects.DataClasses;
using System.Linq;

namespace FMStudio.Domain.SQLite
{
    [MetadataType(typeof(IUseTypeCategory))]
    public partial class UseTypeCategory : IUseTypeCategory, IDataErrorInfo
    {
        #region Implement IDataErrorInfo Interface
        [NonSerialized]
        private readonly DataErrorInfoSupport dataErrorInfoSupport;

        string IDataErrorInfo.Error { get { return this.dataErrorInfoSupport.Error; } }

        string IDataErrorInfo.this[string memberName] { get { return this.dataErrorInfoSupport[memberName]; } }
        #endregion


        public UseTypeCategory()
        {
            this.dataErrorInfoSupport = new DataErrorInfoSupport(this);

            //  Default value
            this.Name = string.Empty;
        }


        #region Implement IUseTypeCategory Interface
        EntityCollection<IUseType> IUseTypeCategory.UseTypes
        {
            get { return this.UseTypes.Cast<IUseType>() as EntityCollection<IUseType>; }
        }
        #endregion
    }
}
